<template>
  <div>
    <Form :model="formItem" :label-width="120" inline>
      <Tabs value="name0">
        <TabPane :label="$t('equipment.region')" name="name0">
          <Row>
            <Col span="24">
              <FormItem
                :label="
                  $t('equipment.sell') +
                  '/' +
                  $t('equipment.rent') +
                  $t('equipment.address')
                "
              >
                <Select v-model="form.deviceName">
                  <Option value="beijing">New York</Option>
                  <Option value="shanghai">London</Option>
                  <Option value="shenzhen">Sydney</Option>
                </Select>
              </FormItem>
            </Col>
          </Row>
          <Row>
            <Col span="24">
              <FormItem :label="$t('equipment.specificAddress')">
                <Input
                  v-model="form.input"
                  :placeholder="$t('onEnter')"
                ></Input>
              </FormItem>
            </Col>
          </Row>
        </TabPane>
      </Tabs>
      <Tabs value="name1">
        <TabPane :label="$t('baseInfo')" name="name1">
          <Row>
            <Col span="12">
              <FormItem :label="$t('equipment.deviceName')">
                <Input
                  v-model="form.phone"
                  :placeholder="$t('onEnter')"
                  readonly
                ></Input>
              </FormItem>
            </Col>
            <Col span="12">
              <FormItem :label="$t('equipment.sellType')">
                <RadioGroup v-model="phone">
                  <Radio :label="$t('equipment.sell')">
                    <span>{{$t('equipment.sell')}}</span>
                  </Radio>
                  <Radio :label="$t('equipment.rent')">
                    <span>{{$t('equipment.rent')}}</span>
                  </Radio>
                </RadioGroup>
              </FormItem>
            </Col>
          </Row>
          <Row>
            <Col span="12">
              <FormItem :label="$t('equipment.deviceName')">
                <Input
                  v-model="form.phone"
                  :placeholder="$t('onEnter')"
                  readonly
                ></Input>
              </FormItem>
            </Col>
            <Col span="12">
              <FormItem :label="$t('equipment.serialNumber') + 'ID'">
                <Input
                  v-model="form.phone"
                  :placeholder="$t('onEnter')"
                  readonly
                ></Input>
              </FormItem>
            </Col>
          </Row>
          <Row>
            <Col span="12">
              <FormItem :label="$t('equipment.status')">
                <Input
                  v-model="form.phone"
                  :placeholder="$t('onEnter')"
                  readonly
                ></Input>
              </FormItem>
            </Col>
            <Col span="12">
              <FormItem :label="$t('equipment.outStorageTime')">
                <Input
                  v-model="form.phone"
                  :placeholder="$t('onEnter')"
                  readonly
                ></Input>
              </FormItem>
            </Col>
          </Row>
        </TabPane>
      </Tabs>
      <div
        style="
          display: flex;
          justify-content: space-around;
          width: 200px;
          margin: 20px auto;
        "
      >
        <Button type="primary" @click="onsubmit">{{ $t("onSubmit") }}</Button>
        <Button type="default" @click="goback(false)">{{
          $t("onCancle")
        }}</Button>
      </div>
    </Form>
  </div>
</template>

<script>
import { addMedEquipment, editMedEquipment } from "@/api/index";
export default {
  props: ["item"],
  data() {
    return {
      form: {},
    };
  },
  mounted() {
    this.form = this.item;
  },
  methods: {
    goback(status) {
      this.$emit("handlerdevice", status);
    },
    onsubmit() {
      if (this.form.id) {
        //表示更新
        this.goback(true);
      } else {
        //便是新增
        this.goback(true);
      }
    },
  },
};
</script>

<style>
</style>